package sctu.edu.java.year2016.team01.zhuming.day20160614;

import sctu.edu.java.year2016.team08.yangying.day20160527.chapter7_1.S;

/**
 * Created by Administrator on 2016/6/14.
 */
public class ThrowClient {
     private double Pi=3.14;

    public void Circlearea(double r) throws Exception {
        if(r<10)
            throw new Exception("圆的半径是：\n" +"圆的半径不能小于10 \n");

        else {
            double circlearea = Pi * r * r;
            System.out.println("输出圆的半径必须大于10：");
            System.out.println("圆的面积是:"+circlearea);
        }

    }

    public static void main(String[] args) {

        ThrowClient throwClient=new ThrowClient();
        try {
            throwClient.Circlearea(4);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("    "+e.toString());
        }

    }

}
